#ifndef ADDNEWDYE_H
#define ADDNEWDYE_H

#include <QDialog>
#include <QRegExp>
#include <QRegExpValidator>
#include <QAbstractButton>

#include "DyelibraryService.h"
#include "ConfigFileservice.h"
#include "custommessagebox.h"

namespace Ui {
class AddNewDye;
}

class AddNewDye : public QDialog
{
    Q_OBJECT

public:
    explicit AddNewDye(QWidget *parent = nullptr);
    ~AddNewDye();
    /* 新染料 */
    struct DyeStruct{
        int id;
        QString dyeName;
        QString waveLength;
        QString dyeCreator;
        QString dyeType;
        QString status;
        QString createTime;
        QString reviseTime;
    };

    DyeStruct newDye;
    QList<QHash<QString, QString>> allDyeInfos;
    DyeLibrary *DLDB;
    ConfigFileService *configFileService;
    CustomMessageBox *cusMsg;

public slots:
    void getNewDyeInfo();
    void getDyeType(QAbstractButton*);

signals:
    void newDyeInfo(AddNewDye::DyeStruct);

private:
    Ui::AddNewDye *ui;
};

#endif // ADDNEWDYE_H
